var express = require('express');
const tokens = require('../services/tokenService');
const studentController = require('../controllers/admin/studentController');
const notifyController = require('../controllers/admin/notifyController');

var router = express.Router();
//
// router.post('/login', studentController.login);
// router.get('/info', studentController.info);
// router.post('/logout', studentController.logout);

router.all('*',function (req,res,next) {
  tokens.checkToken(req.header('x-token'), function (err,decode) {
    if (err)
      return res.send({code: 50014, message: '身份校验失败'});
    req.decode = decode;
    next()
  })
});

router.get('/notify/get',notifyController.getNotify);

module.exports = router;
